namespace Asmex.FileViewer
{
    using Asmex.ObjViewer;
    using System;
    using System.IO;

    public class DOSStub : Region
    {
        private uint _PEPos;

        public DOSStub(BinaryReader reader)
        {
            if (reader.ReadUInt16() != 0x5a4d)
            {
                throw new ModException("DOSStub: Invalid DOS header.");
            }
            reader.BaseStream.Position = 60L;
            this._PEPos = reader.ReadUInt32();
            base.Start = 0L;
            base.Length = 0x40L;
        }

        public uint PEHeaderOffset
        {
            get
            {
                return this._PEPos;
            }
        }

        [ObjViewer(Hex=true)]
        public uint PEPos
        {
            get
            {
                return this._PEPos;
            }
        }
    }
}
